﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class Singleton<T> where T : new()
{
    private static T instance;

    public static T Instance
    {
        get
        {
            if (Singleton<T>.instance == null)
            {
                Singleton<T>.instance = (default(T) == null) ? new T() : default(T);
            }
            return Singleton<T>.instance;
        }
    }

    protected Singleton()
    {

    }

}

